#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int MAXN = 5e4+10;

typedef long long ll;
typedef double db;

int n;
char op[10];
bool vis[MAXN<<2];

struct func{
	db k,b;
	func(db x = 0,db y = 0) : k(x),b(y) {}
	db operator ()(int x){return k * x + b;}
	db const operator ()(int x)const{return k * x+b;}
	friend func fmax(func a,func b,int x){
		if(a(x) > b(x)) return a;
		return b;
	}
	friend double crossover(func x,func y){
		return (x.b - y.b) / (y.k - x.k);
	}
}f[MAXN<<2];

void insert(func v,int o = 1,int l = 1,int r = MAXN-1){
	if(!vis[o]) return (void)(f[o] = v,vis[o] = 1);
	int mid = (l+r)>>1;
	if(l == r){
		f[o] = fmax(f[o],v,l);return;
	}
	db cr = crossover(v,f[o]);
	db l1 = f[o](l),l2 = v(l),r1 = f[o](r),r2 = v(r);
	if(l1 >= l2 && r1 >= r2) return;
	if(l2 >= l1 && r2 >= r1) return (void)(f[o] = v);
	if(l1 <= l2){
		if(cr <= mid) insert(v,o<<1,l,mid);
		else insert(f[o],o<<1|1,mid+1,r),f[o] = v;
	}else {
		if(cr > mid) insert(v,o<<1|1,mid+1,r);
		else insert(f[o],o<<1,l,mid),f[o] = v;
	}
}

func qmax(int pos,int o = 1,int l = 1,int r = MAXN-1){
	if(l == r) return f[o];
	func ans;
	if(vis[o]) ans = f[o];
	int mid = (l+r)>>1;
	if(pos <= mid) ans = fmax(ans,qmax(pos,o<<1,l,mid),pos);
	else ans = fmax(ans,qmax(pos,o<<1|1,mid+1,r),pos);
	return ans;
}

int main (){
	scanf("%d",&n);
	while(n--){
		scanf("%s",op);
		if(op[0] == 'Q'){
			int T; scanf("%d",&T);
			db ans = qmax(T)(T);
			ans/=100;
			printf("%lld\n",(ll)ans);
		}else{
			db s,p; scanf("%lf %lf",&s,&p);
			func ff = (func){p,s-p};
			insert(ff);
		}
	}
	return 0;
}
